package com.demo.consumer.controller.apm;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.client.RestTemplate;


public class MyRunnable implements Runnable{

    @Value("${stock_provider_url}")
    String stockProviderUrl;

     private RestTemplate restTemplate;
     private static final Logger log = LoggerFactory.getLogger(ApmDeomController.class);

     public MyRunnable(RestTemplate restTemplate){
         this.restTemplate = restTemplate;
     }

    @Override
    public void run() {
         log.info("apm controller run方法被调用，调用provider /apm/timelay");
         restTemplate.getForObject(stockProviderUrl+"/apm/timelay",String.class);
    }
}
